package com.xiaoc.bulldozer.common;

import com.xc.framework.common.utils.NumberUtil;

/**
 * describe:
 *
 * @author lihuancheng
 * @date 2018/9/27
 */
public enum PosterCode {

    //物料海报对应关系
    FIRST_PICTURE(1, "亲情快贷"), SECOND_PICTURE(2, "种养兴农贷"), THREE_PICTURE(3, "宜商快贷"), FOUR_PICTURE(4, "工匠快贷"),

    FIVE_PICTURE(5, "电商快贷"), SIX_PICTURE(6, "休闲兴农贷"), SEVEN_PICTURE(7, "产业兴农贷"), EIGHT_PICTURE(8, "税易贷"),

    NINE_PICTURE(9, "白领易贷"), TEN_PICTURE(10, "房主易贷"), ELEVEN_PICTURE(11, "车主易贷"), TWELVE_PICTURE(12, "装修易贷"),

    THIRTEEN_PICTURE(13, "车位易贷"), FOURTEEN_PICTURE(14, "汽车易贷");

    private int index;

    private String pictureName;

    private PosterCode(int index, String pictureName) {
        this.index = index;
        this.pictureName = pictureName;
    }


    public static String getPictureName(Integer index) {
        PosterCode[] posterCodes = values();
        for (PosterCode code : posterCodes) {
            if (NumberUtil.equals(code.index, index)) {
                return code.pictureName;
            }
        }
        return null;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public String getPictureName() {
        return pictureName;
    }

    public void setPictureName(String pictureName) {
        this.pictureName = pictureName;
    }
    }
